﻿using System;
using System.Net;

namespace HttpWebClient_Sample
{
    static class Program
    {
        static void Main()
        {
            var webClient = new WebClient();
            webClient.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) " + 
                "(compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
            var byteArray = webClient.DownloadData("http://127.0.0.1");
            var stringData = webClient.DownloadString("http://127.0.0.1");
            
            Console.WriteLine("Response: " + BitConverter.ToString(byteArray));
            Console.WriteLine("\n\nResponse: " + stringData);

            Console.ReadLine();
        }
    }
}
